.class public Lcom/zuiapps/library/download/UpgradeAppDownloadManager;
.super Lcom/zuiapps/library/download/UpgradeFileDownloadManager;
.source "UpgradeAppDownloadManager.java"


# static fields
.field private static mAppDownloadManager:Lcom/zuiapps/library/download/UpgradeAppDownloadManager;


# instance fields
.field private downloadDir:Ljava/lang/String;


# direct methods
.method static constructor <clinit>()V
    .registers 1

    .prologue
    .line 12
    const/4 v0, 0x0

    sput-object v0, Lcom/zuiapps/library/download/UpgradeAppDownloadManager;->mAppDownloadManager:Lcom/zuiapps/library/download/UpgradeAppDownloadManager;

    return-void
.end method

.method private constructor <init>(Landroid/content/Context;)V
    .registers 3
    .param p1, "context"    # Landroid/content/Context;

    .prologue
    .line 16
    invoke-direct {p0, p1}, Lcom/zuiapps/library/download/UpgradeFileDownloadManager;-><init>(Landroid/content/Context;)V

    .line 13
    const-string v0, "/Download/"

    iput-object v0, p0, Lcom/zuiapps/library/download/UpgradeAppDownloadManager;->downloadDir:Ljava/lang/String;

    .line 17
    return-void
.end method

.method private constructor <init>(Landroid/content/Context;Ljava/lang/String;)V
    .registers 4
    .param p1, "context"    # Landroid/content/Context;
    .param p2, "downloadDir"    # Ljava/lang/String;

    .prologue
    .line 20
    invoke-direct {p0, p1}, Lcom/zuiapps/library/download/UpgradeFileDownloadManager;-><init>(Landroid/content/Context;)V

    .line 13
    const-string v0, "/Download/"

    iput-object v0, p0, Lcom/zuiapps/library/download/UpgradeAppDownloadManager;->downloadDir:Ljava/lang/String;

    .line 21
    iput-object p2, p0, Lcom/zuiapps/library/download/UpgradeAppDownloadManager;->downloadDir:Ljava/lang/String;

    .line 22
    return-void
.end method

.method public static getInstance(Landroid/content/Context;)Lcom/zuiapps/library/download/UpgradeAppDownloadManager;
    .registers 3
    .param p0, "context"    # Landroid/content/Context;

    .prologue
    .line 25
    sget-object v0, Lcom/zuiapps/library/download/UpgradeAppDownloadManager;->mAppDownloadManager:Lcom/zuiapps/library/download/UpgradeAppDownloadManager;

    if-nez v0, :cond_f

    .line 26
    const-class v1, Lcom/zuiapps/library/download/UpgradeAppDownloadManager;

    monitor-enter v1

    .line 27
    :try_start_7
    new-instance v0, Lcom/zuiapps/library/download/UpgradeAppDownloadManager;

    invoke-direct {v0, p0}, Lcom/zuiapps/library/download/UpgradeAppDownloadManager;-><init>(Landroid/content/Context;)V

    sput-object v0, Lcom/zuiapps/library/download/UpgradeAppDownloadManager;->mAppDownloadManager:Lcom/zuiapps/library/download/UpgradeAppDownloadManager;

    .line 28
    monitor-exit v1
    :try_end_f
    .catchall {:try_start_7 .. :try_end_f} :catchall_12

    .line 30
    :cond_f
    sget-object v0, Lcom/zuiapps/library/download/UpgradeAppDownloadManager;->mAppDownloadManager:Lcom/zuiapps/library/download/UpgradeAppDownloadManager;

    return-object v0

    .line 28
    :catchall_12
    move-exception v0

    :try_start_13
    monitor-exit v1
    :try_end_14
    .catchall {:try_start_13 .. :try_end_14} :catchall_12

    throw v0
.end method

.method public static getInstance(Landroid/content/Context;Ljava/lang/String;)Lcom/zuiapps/library/download/UpgradeAppDownloadManager;
    .registers 6
    .param p0, "context"    # Landroid/content/Context;
    .param p1, "downloadUrl"    # Ljava/lang/String;

    .prologue
    .line 34
    sget-object v2, Lcom/zuiapps/library/download/UpgradeAppDownloadManager;->mAppDownloadManager:Lcom/zuiapps/library/download/UpgradeAppDownloadManager;

    if-nez v2, :cond_f

    .line 35
    const-class v3, Lcom/zuiapps/library/download/UpgradeAppDownloadManager;

    monitor-enter v3

    .line 36
    :try_start_7
    new-instance v2, Lcom/zuiapps/library/download/UpgradeAppDownloadManager;

    invoke-direct {v2, p0, p1}, Lcom/zuiapps/library/download/UpgradeAppDownloadManager;-><init>(Landroid/content/Context;Ljava/lang/String;)V

    sput-object v2, Lcom/zuiapps/library/download/UpgradeAppDownloadManager;->mAppDownloadManager:Lcom/zuiapps/library/download/UpgradeAppDownloadManager;

    .line 37
    monitor-exit v3
    :try_end_f
    .catchall {:try_start_7 .. :try_end_f} :catchall_3f

    .line 39
    :cond_f
    sget-object v2, Lcom/zuiapps/library/download/UpgradeAppDownloadManager;->mAppDownloadManager:Lcom/zuiapps/library/download/UpgradeAppDownloadManager;

    iput-object p1, v2, Lcom/zuiapps/library/download/UpgradeAppDownloadManager;->downloadDir:Ljava/lang/String;

    .line 41
    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    invoke-static {}, Lcom/zuiapps/library/util/UpgradeIOUtil;->getSDCardPath()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    sget-object v3, Ljava/io/File;->separator:Ljava/lang/String;

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    .line 42
    .local v0, "dir":Ljava/lang/String;
    new-instance v1, Ljava/io/File;

    invoke-direct {v1, v0}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 43
    .local v1, "downloadDir":Ljava/io/File;
    invoke-virtual {v1}, Ljava/io/File;->exists()Z

    move-result v2

    if-nez v2, :cond_3c

    .line 44
    invoke-virtual {v1}, Ljava/io/File;->mkdirs()Z

    .line 47
    :cond_3c
    sget-object v2, Lcom/zuiapps/library/download/UpgradeAppDownloadManager;->mAppDownloadManager:Lcom/zuiapps/library/download/UpgradeAppDownloadManager;

    return-object v2

    .line 37
    .end local v0    # "dir":Ljava/lang/String;
    .end local v1    # "downloadDir":Ljava/io/File;
    :catchall_3f
    move-exception v2

    :try_start_40
    monitor-exit v3
    :try_end_41
    .catchall {:try_start_40 .. :try_end_41} :catchall_3f

    throw v2
.end method


# virtual methods
.method public getBaseDownloadPath()Ljava/lang/String;
    .registers 2

    .prologue
    .line 56
    iget-object v0, p0, Lcom/zuiapps/library/download/UpgradeAppDownloadManager;->downloadDir:Ljava/lang/String;

    return-object v0
.end method

.method public getDownloadFilePath(Ljava/lang/String;)Ljava/lang/String;
    .registers 4
    .param p1, "url"    # Ljava/lang/String;

    .prologue
    .line 51
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    invoke-static {}, Lcom/zuiapps/library/util/UpgradeIOUtil;->getSDCardPath()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    sget-object v1, Ljava/io/File;->separator:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-object v1, p0, Lcom/zuiapps/library/download/UpgradeAppDownloadManager;->downloadDir:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {p0, p1}, Lcom/zuiapps/library/download/UpgradeAppDownloadManager;->getFileName(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getFileName(Ljava/lang/String;)Ljava/lang/String;
    .registers 6
    .param p1, "url"    # Ljava/lang/String;

    .prologue
    .line 61
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    invoke-static {p1}, Lcom/zuiapps/library/util/UpgradeMD5Util;->crypt(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, "_"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v2

    invoke-virtual {v0, v2, v3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, ".apk"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public postDowload(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
    .registers 5
    .param p1, "downloadStatus"    # I
    .param p2, "filePath"    # Ljava/lang/String;
    .param p3, "url"    # Ljava/lang/String;
    .param p4, "displayName"    # Ljava/lang/String;

    .prologue
    .line 72
    return-void
.end method

.method public preDowload(Ljava/lang/String;Ljava/lang/String;)V
    .registers 3
    .param p1, "url"    # Ljava/lang/String;
    .param p2, "displayName"    # Ljava/lang/String;

    .prologue
    .line 67
    return-void
.end method
